function createObject(o) {
  function Fn() {}
  Fn.prototype = o;
  return new Fn();
}

function inheritPrototype(SubType, SuperType) {
  SubType.prototype = createObject(SuperType.prototype);
  Object.defineProperty(SubType.prototype, "constructor", {
    enumerable: false,
    configurable: true,
    writable: true,
    value: SubType,
  });
}

function Person() {}

function Student() {}

inheritPrototype(Student, Person);

var stu = new Student();

// 判断当前构造函数的原型对象有没有出现在实例对象上的原型链中
console.log(stu instanceof Student);
console.log(stu instanceof Person);
console.log(stu instanceof Object);
